<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8" import="java.util.*"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ request.getContextPath() + "/";
//response.sendRedirect("common/login");
%>
<c:set var="path" value="${'$'}{pageContext.request.contextPath}" />
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>${MODEL.beanName}List</title>
			<script type="text/javascript" src="${'$'}{path }/resource/js/jquery-2.0.3.js"></script>
			<script type="text/javascript" src="${'$'}{path }/resource/js/mytools.js"></script>
			<script type="text/javascript" src="${'$'}{path }/resource/layer/layer.js"></script>
			<link rel="stylesheet" href="${'$'}{path }/resource/bootstrap/css/bootstrap.min.css" />
			<link rel="stylesheet" href="${'$'}{path }/resource/bootstrap/css/bootstrap-responsive.min.css" />
	</head>
	<body>
	<form id="searchFrom" class="form-inline">
	<#list MODEL.property as item >
	<div class="input-group">
	 	<div class="input-group-addon">${item.PROPERTY}:</div>
		<input type="text"  class="form-control" name="${item.PROPERTY}" />
		</div>
	</#list>
	<input type="button" class="btn btn-primary btn-sm" value="查询" onclick=" mjs.search()"/>
	</form>
	<br>
	<input type="button" value="新增${MODEL.beanName}" onclick="mjs.editFrom()" class="btn btn-success btn-sm"/>
	<br><br>
	<div id="tablediv">
	<table id="table1" class="table table-bordered table-hover table-condensed">
	<thead id="thead">
		<#list MODEL.property as item >
		<#if item_index!=0>
		<th data-name = "${item.PROPERTY}">${item.PROPERTY}</th>  
		<#else>
		<th data-name = "${item.PROPERTY}" data-format="operation">操作</th>  
		</#if>
		</#list>
	</thead>
	</table>
	</div>
	<br>
	<script>
	var mjs =	mytooljs.initTable({  
		idSelecter:"#table1",
		sendurl:"${'$'}{path}/user/${MODEL.detailPackge}/${MODEL.beanName}/showList" , //求数据的地址
		pagesize:5,//分页大小
		delUrl:"${'$'}{path}/user/${MODEL.detailPackge}/${MODEL.beanName}/del",//删除数据地址
		editUrl:"${'$'}{path}/user/${MODEL.detailPackge}/${MODEL.beanName}/editForm" //打开编辑或新增页面地址
		});
	
	//操作
	function operation(id){
		var	html="";
		html+="<input type='button' value='编辑' class='btn btn-default btn-sm' onclick='mjs.editFrom("+id+")' />"
		html+="<input type='button' value='删除' class='btn btn-default btn-sm' onclick='mjs.delRec("+id+")' />"
		return html;
	}
	</script>
	</body>
</html>
